package com.jeeplus.modules.statistics.service;

import com.alibaba.fastjson.JSON;
import com.jeeplus.common.utils.RedisUtils;
import com.jeeplus.database.datasource.annotation.DS;
import com.jeeplus.modules.statistics.model.constant.Constant;
import com.jeeplus.modules.statistics.mapper.BusinessMapper;
import com.jeeplus.modules.statistics.model.domain.Business;
import com.jeeplus.modules.sys.utils.UserUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: BusinessService
 * Function:  办理业务
 * Date:      2021/3/12 15:58
 *
 * @author hanKongbin
 * version    V1.0
 */
@DS("queuing")
@Service
@Slf4j
@RequiredArgsConstructor
public class BusinessService {

    private final BusinessMapper businessMapper;

    private final RedisUtils redisUtils;

    @Value("${statistics.cache.expiretime.business}")
    private long expireTime;

    public List<Business> findBusiness(String areaNo) {
        List<Business> data = businessMapper.selectBusByAreaNo(areaNo, "%"+UserUtils.getUser().getId()+"%");
        return data;
    }
}
